<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>奔逸协同工作平台-系统管理登陆</title>
    <link rel="stylesheet" href="static/css/reset.css?v=${version}" type="text/css"></link>
  	<link rel="stylesheet" href="static/css/login.css?v=${version}" type="text/css"></link>
  <body>
    <div class="wrap">
    	<div class="login_box">
    		<div class="msg"></div>
    		<table>
    			<tr>
    				<td class="lable">账 号</td>
    				<td colspan="2"><input id="accountNumber"/></td>
    			</tr>
    			<tr>
    				<td class="lable">密 码</td>
    				<td colspan="2"><input type="password" id="password"/></td>
    			</tr>
    			<tr>
    				<td class="lable">验 证</td>
    				<td><input class="code" id="code"/></td>
    				<td><img alt="验证码" src="code.do" class="code-img"> </td>
    			</tr>
    			<tr>
    				<td colspan="3" align="center">
    					<a href="javascript:void(0)" id="login"></a>
    					<a href="javascript:void(0)" id="reset"></a>
    				</td>
    			</tr>
    		</table>
    	</div>
    	<div class="notice_box">
    	
    	</div>
    	<div class="copyright">
    	<p>Copyright (c) 2012 <a title="奔逸" href="http://beny.btboys.com" target="_blank">Beny</a> Information Technology Co., Ltd. All Rights Reserved.</p>
    	</div>
    	<div class="version" title="奔逸协同工作平台V0.1">
    		V${version}
    	</div>
    </div>
    <script type="text/javascript" src="static/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
    	$(function(){
    		$('#accountNumber').focus();
    		
    		$('#login').on("click",function(){
    			var accountNumber = $.trim($('#accountNumber').val());
    			var password = $('#password').val();
    			var code = $.trim($('#code').val());
    			if(!accountNumber){
    				$('.msg').text("账号不能为空!");
    				$('#accountNumber').focus();
    				return;
    			}
				if(!password){
					$('.msg').text("密码不能为空!");
					$('#password').focus();
					return;	
				}
				if(!code){
					$('.msg').text("输入验证码!");
					$('#code').focus();
					return;
				}
				
				$.post('accountuser/auth.do',{accountNumber:accountNumber,password:password,code:code},function(rsp){
					
				},'JSON');
    		});
    		
    		$("#reset").on("click",function(){
    			$('#accountNumber').val("").focus();
    			$('#password').val("");
    			$('#code').val("");
    		});
    		
    		$(".login_box input").on("keyup",function(e){
    			if(e.keyCode === 13){
    				$('#login').click();
    			}
    		});
    		$(".code-img").on("click",function(){
    			$(this).attr("src","code.do");
    		});
    	});
    </script>
  </body>
</html>